package tech.aistar.day06.design.dp.version02;

/**
 * 本类用来演示: 人购买房子
 *
 * @author: success
 * @date: 2021/3/15 4:17 下午
 */
public class Person {

    //人只要和中介产生依赖
    //符合最少知道原则
    private Middler middler;

    public void setMiddler(Middler middler) {
        this.middler = middler;
    }

    public void buyHigh(String name){
        middler.findHigh(name);
    }

    public void buyVilla(String name){
        middler.findVilla(name);
    }

}
